import  List from "@/views/list/List.vue"
import  News from "@/views/news/News.vue"
import  NotFound from "@/views/NotFound.vue"
export default [
    {path:'/',redirect:"/home"},
    // 动态引入组件
    {
     path:'/home',
     name:"home",
     meta:{
         active:"home"
     },
     component:() => import("@/views/home/Home.vue"),
     children:[
        {path:'/home',redirect:"/home/add"},
        {
          // 如果不是绝对路径 表示和父级路径进行拼接
          path:'add',
          name:"homeadd",
          meta:{
            active:"add",
            pActive:"home"
        },
          component:() => import("@/views/home/Add.vue"),
        },
        {
          path:'/home/edit',
          name:"homeedit",
          meta:{
            active:"edit",
            pActive:"home"
        },
          component:() => import("@/views/home/Edit.vue"),
        },
        {
          path:'/home/del',
          name:"homedel",
          meta:{
            active:"del",
            pActive:"home"
        },
          component:() => import("@/views/home/Del.vue"),
        }
     ]
    },
    {path:'/news',name:"news",
    meta:{
      active:"news"
  }
    ,component:News},
    {path:'/list',name:"list",
    meta:{
      active:"list"
  },component:List},
    {path:'/params',name:"params",
    meta:{
      active:"params"
  },component:() => import("@/views/Params.vue")},
    // url 占位符传参
    {path:'/params/:id/:name',name:"params",component:() => import("@/views/Params.vue")},

   
    
    {path:'*',component:NotFound}
]